/**
 * 
 */
package com.atung.provider;

import org.apache.ibatis.jdbc.SQL;

import com.atung.model.BusOrderRefund;

/**
 * 
 * @author lc <br>
 * 2020年11月23日 下午6:31:35
 */
public class BusOrderRefundProvider {

    public String insert(BusOrderRefund orderRefund){
        
        return new SQL(){
            {
                INSERT_INTO("bus_order_refund");
                VALUES("order_id", "#{orderId}");
                VALUES("open_id", "#{openId}");
                if (orderRefund.getRefundId() != null) {
                    VALUES("refund_id", "#{refundId}");
                }
                if (orderRefund.getWxRefund() != null) {
                    VALUES("wx_refund", "#{wxRefund}");
                }
                VALUES("total_fee", "#{totalFee}");   
                VALUES("refund_fee", "#{refundFee}");
                VALUES("refund_state", "#{refundState}");
                VALUES("refund_desc", "#{refundDesc}");
                if (orderRefund.getRefundExplain()!= null) {
                    VALUES("refund_explain", "#{refundExplain}");
                }
                VALUES("refund_time", "#{refundTime}");
                VALUES("rout_expiration_time", "#{routExpirationTime}");
                if (orderRefund.getIsDelect() != null) {
                    VALUES("is_delect", "#{isDelect}");
                }
                VALUES("creation_time", "#{creationTime}");
                VALUES("modification_time", "#{modificationTime}");
            }
        }.toString();
    }

}
